.class Lrexsee/storage/RexseeZIP$2;
.super Lrexsee/core/browser/clazz/SyncTask$BooleanRunnable;
.source "RexseeZIP.java"


# annotations
.annotation system Ldalvik/annotation/EnclosingMethod;
    value = Lrexsee/storage/RexseeZIP;->unGzip(Ljava/lang/String;Ljava/lang/String;ZZ)Z
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x0
    name = null
.end annotation


# instance fields
.field final synthetic this$0:Lrexsee/storage/RexseeZIP;

.field private final synthetic val$source:Ljava/lang/String;

.field private final synthetic val$target:Ljava/lang/String;


# direct methods
.method constructor <init>(Lrexsee/storage/RexseeZIP;Ljava/lang/String;Ljava/lang/String;)V
    .locals 0

    .prologue
    .line 1
    iput-object p1, p0, Lrexsee/storage/RexseeZIP$2;->this$0:Lrexsee/storage/RexseeZIP;

    iput-object p2, p0, Lrexsee/storage/RexseeZIP$2;->val$source:Ljava/lang/String;

    iput-object p3, p0, Lrexsee/storage/RexseeZIP$2;->val$target:Ljava/lang/String;

    .line 205
    invoke-direct {p0}, Lrexsee/core/browser/clazz/SyncTask$BooleanRunnable;-><init>()V

    return-void
.end method


# virtual methods
.method public run()Z
    .locals 11

    .prologue
    const/4 v10, 0x0

    .line 208
    iget-object v7, p0, Lrexsee/storage/RexseeZIP$2;->val$source:Ljava/lang/String;

    invoke-static {v7}, Lrexsee/core/utilities/Utilities;->prepareReadFile(Ljava/lang/String;)Ljava/io/File;

    move-result-object v5

    .line 209
    .local v5, "sourceFile":Ljava/io/File;
    if-nez v5, :cond_0

    .line 210
    iget-object v7, p0, Lrexsee/storage/RexseeZIP$2;->this$0:Lrexsee/storage/RexseeZIP;

    # getter for: Lrexsee/storage/RexseeZIP;->mBrowser:Lrexsee/core/browser/Browser;
    invoke-static {v7}, Lrexsee/storage/RexseeZIP;->access$0(Lrexsee/storage/RexseeZIP;)Lrexsee/core/browser/Browser;

    move-result-object v7

    iget-object v8, p0, Lrexsee/storage/RexseeZIP$2;->this$0:Lrexsee/storage/RexseeZIP;

    invoke-virtual {v8}, Lrexsee/storage/RexseeZIP;->getInterfaceName()Ljava/lang/String;

    move-result-object v8

    const-string v9, "Source file is not available."

    invoke-virtual {v7, v8, v9}, Lrexsee/core/browser/Browser;->exception(Ljava/lang/String;Ljava/lang/String;)V

    move v7, v10

    .line 231
    :goto_0
    return v7

    .line 213
    :cond_0
    iget-object v7, p0, Lrexsee/storage/RexseeZIP$2;->val$target:Ljava/lang/String;

    invoke-static {v7}, Lrexsee/core/utilities/Utilities;->prepareWriteFile(Ljava/lang/String;)Ljava/io/File;

    move-result-object v6

    .line 214
    .local v6, "targetFile":Ljava/io/File;
    if-nez v6, :cond_1

    .line 215
    iget-object v7, p0, Lrexsee/storage/RexseeZIP$2;->this$0:Lrexsee/storage/RexseeZIP;

    # getter for: Lrexsee/storage/RexseeZIP;->mBrowser:Lrexsee/core/browser/Browser;
    invoke-static {v7}, Lrexsee/storage/RexseeZIP;->access$0(Lrexsee/storage/RexseeZIP;)Lrexsee/core/browser/Browser;

    move-result-object v7

    iget-object v8, p0, Lrexsee/storage/RexseeZIP$2;->this$0:Lrexsee/storage/RexseeZIP;

    invoke-virtual {v8}, Lrexsee/storage/RexseeZIP;->getInterfaceName()Ljava/lang/String;

    move-result-object v8

    const-string v9, "Error on creating target file."

    invoke-virtual {v7, v8, v9}, Lrexsee/core/browser/Browser;->exception(Ljava/lang/String;Ljava/lang/String;)V

    move v7, v10

    .line 216
    goto :goto_0

    .line 219
    :cond_1
    :try_start_0
    new-instance v2, Ljava/util/zip/GZIPInputStream;

    new-instance v7, Ljava/io/FileInputStream;

    invoke-direct {v7, v5}, Ljava/io/FileInputStream;-><init>(Ljava/io/File;)V

    invoke-direct {v2, v7}, Ljava/util/zip/GZIPInputStream;-><init>(Ljava/io/InputStream;)V

    .line 220
    .local v2, "in":Ljava/util/zip/GZIPInputStream;
    new-instance v3, Ljava/io/FileOutputStream;

    invoke-direct {v3, v6}, Ljava/io/FileOutputStream;-><init>(Ljava/io/File;)V

    .line 221
    .local v3, "out":Ljava/io/OutputStream;
    const/high16 v7, 0x100000

    new-array v0, v7, [B

    .line 223
    .local v0, "buffer":[B
    :goto_1
    invoke-virtual {v2, v0}, Ljava/util/zip/GZIPInputStream;->read([B)I

    move-result v4

    .local v4, "realLength":I
    if-gtz v4, :cond_2

    .line 226
    invoke-virtual {v2}, Ljava/util/zip/GZIPInputStream;->close()V

    .line 227
    invoke-virtual {v3}, Ljava/io/OutputStream;->close()V

    .line 228
    const/4 v7, 0x1

    goto :goto_0

    .line 224
    :cond_2
    const/4 v7, 0x0

    invoke-virtual {v3, v0, v7, v4}, Ljava/io/OutputStream;->write([BII)V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    goto :goto_1

    .line 229
    .end local v0    # "buffer":[B
    .end local v2    # "in":Ljava/util/zip/GZIPInputStream;
    .end local v3    # "out":Ljava/io/OutputStream;
    .end local v4    # "realLength":I
    :catch_0
    move-exception v7

    move-object v1, v7

    .line 230
    .local v1, "e":Ljava/lang/Exception;
    iget-object v7, p0, Lrexsee/storage/RexseeZIP$2;->this$0:Lrexsee/storage/RexseeZIP;

    # getter for: Lrexsee/storage/RexseeZIP;->mBrowser:Lrexsee/core/browser/Browser;
    invoke-static {v7}, Lrexsee/storage/RexseeZIP;->access$0(Lrexsee/storage/RexseeZIP;)Lrexsee/core/browser/Browser;

    move-result-object v7

    iget-object v8, p0, Lrexsee/storage/RexseeZIP$2;->this$0:Lrexsee/storage/RexseeZIP;

    invoke-virtual {v8}, Lrexsee/storage/RexseeZIP;->getInterfaceName()Ljava/lang/String;

    move-result-object v8

    invoke-virtual {v7, v8, v1}, Lrexsee/core/browser/Browser;->exception(Ljava/lang/String;Ljava/lang/Exception;)V

    move v7, v10

    .line 231
    goto :goto_0
.end method
